<template>
  <div class="shop">
    
    <div class="shop-content">
      <div class="points-banner">
        <div class="points-info">
          <h2>我的碳积分</h2>
          <div class="points-display">
            <span class="points-value">2450</span>
            <span class="points-label">碳积分</span>
          </div>
        </div>
        <div class="points-actions">
          <button class="points-btn">积分记录</button>
          <button class="points-btn">获取积分</button>
        </div>
      </div>
      
      <div class="categories-section">
        <div class="category-tabs">
          <button class="category-btn active">全部商品</button>
          <button class="category-btn">环保用品</button>
          <button class="category-btn">绿色食品</button>
          <button class="category-btn">公益捐赠</button>
          <button class="category-btn">优惠券</button>
        </div>
      </div>
      
      <div class="products-grid">
        <div class="product-card">
          <div class="product-image">🌿</div>
          <div class="product-info">
            <h3>环保购物袋</h3>
            <p class="product-desc">可重复使用，减少塑料袋消耗</p>
            <div class="product-price">
              <span class="price">100</span>
              <span class="points-unit">碳积分</span>
            </div>
            <button class="exchange-btn">立即兑换</button>
          </div>
        </div>
        
        <div class="product-card">
          <div class="product-image">♻️</div>
          <div class="product-info">
            <h3>可重复使用水瓶</h3>
            <p class="product-desc">不锈钢材质，保温保冷</p>
            <div class="product-price">
              <span class="price">150</span>
              <span class="points-unit">碳积分</span>
            </div>
            <button class="exchange-btn">立即兑换</button>
          </div>
        </div>
        
        <div class="product-card">
          <div class="product-image">🌳</div>
          <div class="product-info">
            <h3>植树一棵</h3>
            <p class="product-desc">支持环保公益，种植真树</p>
            <div class="product-price">
              <span class="price">200</span>
              <span class="points-unit">碳积分</span>
            </div>
            <button class="exchange-btn">立即兑换</button>
          </div>
        </div>
        
        <div class="product-card">
          <div class="product-image">🌞</div>
          <div class="product-info">
            <h3>太阳能充电器</h3>
            <p class="product-desc">户外便携，绿色能源</p>
            <div class="product-price">
              <span class="price">500</span>
              <span class="points-unit">碳积分</span>
            </div>
            <button class="exchange-btn">立即兑换</button>
          </div>
        </div>
        
        <div class="product-card">
          <div class="product-image">🍃</div>
          <div class="product-info">
            <h3>有机食品礼盒</h3>
            <p class="product-desc">精选有机食材，健康环保</p>
            <div class="product-price">
              <span class="price">300</span>
              <span class="points-unit">碳积分</span>
            </div>
            <button class="exchange-btn">立即兑换</button>
          </div>
        </div>
        
        <div class="product-card">
          <div class="product-image">💚</div>
          <div class="product-info">
            <h3>公益捐赠</h3>
            <p class="product-desc">捐赠10元支持环保项目</p>
            <div class="product-price">
              <span class="price">100</span>
              <span class="points-unit">碳积分</span>
            </div>
            <button class="exchange-btn">立即兑换</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
// 积分商城页面逻辑可以在这里添加
</script>

<style scoped>
.shop {
  padding: 20px;
  width: 100%;
  box-sizing: border-box;
}

.page-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 20px;
  box-sizing: border-box;
}

.page-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #2c3e50;
}

.page-header p {
  font-size: 1.2rem;
  color: #7f8c8d;
}

.points-banner {
  background: linear-gradient(135deg, #42b983 0%, #2a8a64 100%);
  border-radius: 15px;
  padding: 30px;
  color: white;
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  box-sizing: border-box;
}

.points-info h2 {
  margin: 0 0 15px 0;
  font-size: 1.8rem;
}

.points-display {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.points-value {
  font-size: 3rem;
  font-weight: bold;
}

.points-label {
  font-size: 1.2rem;
}

.points-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.points-btn {
  padding: 12px 25px;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.points-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.categories-section {
  margin-bottom: 30px;
}

.category-tabs {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.category-btn {
  padding: 12px 25px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 25px;
  color: #495057;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.category-btn:hover,
.category-btn.active {
  background-color: #42b983;
  color: white;
  border-color: #42b983;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  width: 100%;
  box-sizing: border-box;
}

.product-card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s;
  width: 100%;
  box-sizing: border-box;
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-image {
  font-size: 4rem;
  text-align: center;
  padding: 30px 20px;
  background-color: #f8f9fa;
}

.product-info {
  padding: 25px;
  box-sizing: border-box;
}

.product-info h3 {
  margin: 0 0 10px 0;
  color: #2c3e50;
}

.product-desc {
  color: #6c757d;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 20px;
}

.price {
  font-size: 1.8rem;
  font-weight: bold;
  color: #42b983;
}

.points-unit {
  color: #6c757d;
}

.exchange-btn {
  width: 100%;
  padding: 15px;
  background-color: #42b983;
  color: white;
  border: none;
  border-radius: 25px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.exchange-btn:hover {
  background-color: #359c6d;
  transform: scale(1.02);
}

@media (max-width: 768px) {
  .points-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .page-header h1 {
    font-size: 2rem;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
  }
  
  .category-tabs {
    gap: 10px;
  }
  
  .category-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .shop {
    padding: 15px;
  }
  
  .page-header h1 {
    font-size: 1.8rem;
  }
  
  .page-header p {
    font-size: 1rem;
  }
  
  .points-banner {
    padding: 20px;
  }
  
  .points-value {
    font-size: 2.5rem;
  }
  
  .points-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  .product-card {
    margin-bottom: 20px;
  }
  
  .product-info {
    padding: 20px;
  }
  
  .price {
    font-size: 1.5rem;
  }
}
</style>